package com.example.survey23.mapper;

import com.example.survey23.entity.GroupLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 23Group
 * @since 2022-11-05
 */
@Repository
@Mapper
public interface GroupLogMapper extends BaseMapper<GroupLog> {

    @Select("select max(id) from  group_log")
    Long getMaxGroupLogId();

    @Select("select * from  group_log where group_id = #{id}")
    List<GroupLog> getGroupLogByGroupId(long id);

    @Select("select id from group_log where group_id = #{groupId} and member = #{memberId} limit 1")
    Long getDeleteId(long groupId, long memberId);
}
